package com.zhiyou.service.impl;

import com.zhiyou.bean.Comment;
import com.zhiyou.dao.CommentMapper;
import com.zhiyou.service.CommentService;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CommentServiceImpl implements CommentService {

    @Resource
    CommentMapper commentMapper;

    @Override
    public List<Comment> getMyComment(Integer userId) {
        Example example = new Example(Comment.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("userId",userId);
        return commentMapper.selectByExample(example);
    }
}
